FUNCTION calcTotalMortality
  {
	/*
	This routine calculates fishing mortality, total mortality
	and annaul survival rates (exp(-Z)) for each cohort in each
	month.
	
	There is a complication in that if there is a survey gear
	then the fishing mortality rate is set to an extremely small
	value: exp(-70.)~3.975e-31, which is effectively 0.
	
	The above issue is no longer an issue b/c now estimating Fs
	for years where there is non-zero catch.
	*/

	int i,j;
	F.initialize();
	ft.initialize();
	
	//Fishing mortality
	for(j=1;j<=nmo;j++)
 	{
		ft(j)=mfexp(log_ft_pars(j));
		for (int i=1;i<=nco;i++)
		{
			F(j,i)=sel_fish(j,i)*ft(j);
       		}
	}
		
	//Natural mortality
	//M(1,nmo,1,nco);
	M = ones*m;
	M = M/12;
	Z=M+F;
	S=mfexp(-Z);
	if(verbose) cout<<"**** OK after calcTotalMortality ****"<<endl;
	
  }
